package com.ww.microrpc.netty.serializer;

import com.ww.microrpc.netty.serializer.hessian.HessianSerializer;
import com.ww.microrpc.netty.serializer.kryo.KryoSerializer;
import com.ww.microrpc.netty.serializer.protostuff.ProtostuffSerializer;

public class SerializerFactory {
    public static Serializer create(int serializerType) {
        Serializer serializer = null;
        switch (serializerType) {
            case 1:
            case 2:
            case 3:
                serializer = new HessianSerializer();
                break;
            case 4:
                serializer = new KryoSerializer();
                break;
            case 5:
                serializer = new ProtostuffSerializer();
                break;
            default:
                serializer = new HessianSerializer();
        }

        return serializer;
    };
}
